package cs2114.antiFingerMines;


//-------------------------------------------------------------------------
/**
*  class to store coordinates of each cell.
*
*  @author  William Vuong (wnvuong)
*  @version 2012.3.21
*/
public class Location
{
 private float xlocation;
 private float ylocation;

 // ----------------------------------------------------------
 /**
  * Create a new Location object.
  * @param xloc is the xlocation
  * @param yloc is the ylocation
  */
 public Location(float xloc, float yloc)
 {
     xlocation = xloc;
     ylocation = yloc;
 }

 /**
  * gets the xlocation
  * @return float the xlocation
  */
 public float getXloc()
 {
     return xlocation;
 }

 /**
  * gets the ylocation
  * @return float the ylocation
  */
 public float getYloc()
 {
     return ylocation;
 }

 /**
  * sets the xlocation
  * @param xloc is the xlocation
  */
 public void setXloc(float xloc)
 {
     xlocation = xloc;
 }

 /**
  * sets the ylocation
  * @param yloc is the ylocation
  */
 public void setYloc(float yloc)
 {
     ylocation = yloc;
 }

 /**
  * gets the location north of the pofloat
  * @return Location is the location north
  */
 public Location getNorth()
 {
     float y = ylocation - 1;
     return new Location(xlocation, y);
 }

 /**
  * gets the location south of the pofloat
  * @return Location is the location south
  */
 public Location getSouth()
 {
     float y = ylocation + 1;
     return new Location(xlocation, y);
 }

 /**
  * gets the location east of the pofloat
  * @return Location is the location east
  */
 public Location getEast()
 {
     float x = xlocation + 1;
     return new Location(x, ylocation);
 }

 /**
  * gets the location west of the pofloat
  * @return Location is the location west
  */
 public Location getWest()
 {
     float x = xlocation - 1;
     return new Location(x, ylocation);
 }

}
